package cat.joronya.supermanager;


import android.net.Uri;
import android.provider.BaseColumns;

/**
 * Convenience definitions for PrivateLeagueProvider
 */
public final class Supermanager 
{
	public static final String SHARED_PREFS_NAME ="supermanager";
	
	public static final String AUTHORITY_BASE = "cat.joronya.supermanager";
	
	public static final String CACHE_DIR = "cat.joronya.supermanager";
	public static final String PLAYERS = "players";
	
	public static final String STATUS_MESSAGE = "cat.joronya.supermanager.status";
    
	/**
     * Status of the app when the web is closed.
     */
    public static final int CLOSED_STATUS = 0;

    /**
     * Status of the app when the web is opened and operative.
     */
    public static final int OPEN_STATUS = 1;
    
    /**
     * Status of the app when the web is opened but no changes are available.
     */
    public static final int OPEN_NO_CHANGES_STATUS = 2;
    
    /**
     * Status of the app when there's auth error.
     */
    public static final int AUTH_ERROR_STATUS= 3;
    
    /**
     * Status of the app when there's connectivity error.
     */
    public static final int CONNECTIVITY_ERROR_STATUS= 4;
    
    /**
     * Status of the app when there's other error.
     */
    public static final int OTHER_ERROR_STATUS= 5;

    /**
     * Status of the app after init when pending for the login.
     */
	public static final int PENDING_LOGIN = 6;
    
	/**
	 * Status of the app when private leagues parsed successfully.
	 */
	public static final int PRIVATE_LEAGUES_PARSED_OK = 7;
	
	/**
	 * Status of the app when market parsed successfully.
	 */
	public static final int MARKET_PARSED_OK = 8;

	/**
	 * Status of the app when my teams parsed successfully.
	 */
	public static final int MY_TEAMS_PARSED_OK = 9;

	/**
	 * Constant of GUARD_POSITION.
	 */
	public static final String GUARD_POSITION = "GUARD";
	
	/**
	 * Constant of FORWARD_POSITION.
	 */
	public static final String FORWARD_POSITION = "FORWARD";
	
	/**
	 * Constant of CENTER_POSITION.
	 */
	public static final String CENTER_POSITION = "CENTER";
	
	// This class cannot be instantiated
    private Supermanager() {}
    
	/**
     * Private league table
     */
    public static final class PrivateLeague implements BaseColumns 
    {
    	// l'authority de la private league
    	public static final String AUTHORITY = Supermanager.AUTHORITY_BASE+".privateleague";
    	
    	// This class cannot be instantiated
        private PrivateLeague() {}
        
        /**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/privateleagues");

        /**
         * The MIME type of {@link #CONTENT_URI} providing a directory of notes.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/cat.joronya.supermanager.privateleague";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/cat.joronya.supermanager.privateleague";
        
        /**
         * The default sort order for this table
         */
        public static final String DEFAULT_SORT_ORDER = "name ASC";
        
        /**
         * The id of the private league on supermanger.acb.com
         */
        public static final String ID_PRIV = "id_priv";
        public static final String NAME = "name";
        public static final String NUMBER_OF_TEAMS = "number_of_teams";
        public static final String MODIFIED_DATE = "modified";
        
        /**
         * Complete projection.
         */
        public static final String[] PROJECTION = new String[]{
        	_ID,				// 0
        	ID_PRIV,			// 1
        	NAME,				// 2
        	NUMBER_OF_TEAMS		// 3
        };
    }

	/**
     * Private league team table
     */
    public static final class PrivateLeagueTeam implements BaseColumns 
    {
    	// l'authority dels private league teams
    	public static final String AUTHORITY = Supermanager.AUTHORITY_BASE+".privateleagueteam";
    	
    	// This class cannot be instantiated
        private PrivateLeagueTeam() {}
        
        /**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/privateleagueteams");

        /**
         * The MIME type of {@link #CONTENT_URI} providing a directory of notes.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/cat.joronya.supermanager.privateleagueteam";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/cat.joronya.supermanager.privateleagueteam";
        
        /**
         * The default sort order for this table
         */
        public static final String DEFAULT_SORT_ORDER = "points DESC";
        public static final String GENERAL_SORT_ORDER = "general DESC";
        public static final String BROKER_SORT_ORDER = "broker DESC";

        /**
         * The id of the private league on supermanger.acb.com
         */
        public static final String ID_PRIV = "id_priv";
        public static final String _PRIVATE_LEAGUE_ID = "_pl_id";
        public static final String NAME = "name";
        public static final String DAY = "day";
        public static final String MANAGER = "manager";
        public static final String CITY = "city";
        public static final String POINTS = "points";
        public static final String GENERAL = "general";
        public static final String BROKER = "broker";
        public static final String MODIFIED_DATE = "modified";
        
        /**
         * Complete table projection.
         */
        public static final String[] PROJECTION = new String[]{
        	_ID,				// 0
        	ID_PRIV,			// 1
        	_PRIVATE_LEAGUE_ID,	// 2
        	NAME,				// 3
        	DAY,				// 4
        	MANAGER,			// 5
        	CITY,				// 6
        	POINTS,				// 7
        	GENERAL				// 8
        };
    }

	/**
     * My teams table
     */
    public static final class MyTeam implements BaseColumns 
    {
    	// l'authority dels teams
    	public static final String AUTHORITY = Supermanager.AUTHORITY_BASE+".myteam";
    	
    	// This class cannot be instantiated
        private MyTeam() {}
        
        /**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/myteams");

        /**
         * The MIME type of {@link #CONTENT_URI} providing a directory of notes.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/cat.joronya.supermanager.myteam";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/cat.joronya.supermanager.myteam";
        
        /**
         * The default sort order for this table
         */
        public static final String DEFAULT_SORT_ORDER = "points DESC";
        public static final String GENERAL_SORT_ORDER = "general DESC";
        public static final String BROKER_SORT_ORDER = "broker DESC";

        /**
         * The fields of the team on supermanger.acb.com
         */
        public static final String ID_EQU = "id_equ";
        public static final String NAME = "name";
        public static final String DAY = "day";
        public static final String POINTS = "points";
        public static final String GENERAL = "general";
        public static final String BROKER = "broker";
        public static final String POINTS_CLASSIFICATION = "points_classification";
        public static final String GENERAL_CLASSIFICATION = "general_classification";
        public static final String BROKER_CLASSIFICATION = "broker_classification";
        public static final String POINTS_BEST = "points_best";
        public static final String GENERAL_BEST = "general_best";
        public static final String POINTS_AVERAGE = "points_average";
        public static final String BEST_CLASSIFICATION = "best_classification";
        public static final String CASH = "cash";
        public static final String EARNINGS = "earnings";
        public static final String AVERAGE_SEASON = "average_season";
        public static final String AVERAGE_VARIATION = "average_variation";
        public static final String MODIFIED_DATE = "modified";
        
        /**
         * Complete table projection.
         */
        public static final String[] PROJECTION = new String[]{
        	_ID,					// 0
        	ID_EQU,					// 1
        	NAME,					// 2
        	DAY,					// 3
        	POINTS,					// 4
        	GENERAL,				// 5
        	BROKER,					// 6
        	POINTS_CLASSIFICATION,	// 7
        	GENERAL_CLASSIFICATION,	// 8
        	BROKER_CLASSIFICATION,	// 9
        	POINTS_BEST,			// 10
        	GENERAL_BEST,			// 11
        	POINTS_AVERAGE,			// 12
        	BEST_CLASSIFICATION,	// 13
        	CASH,					// 14
        	EARNINGS,				// 15
        	AVERAGE_SEASON,			// 16
        	AVERAGE_VARIATION		// 17
        };
    }
    
	/**
     * My teams detail table
     */
    public static final class MyTeamDetail implements BaseColumns 
    {
    	// l'authority dels team detail
    	public static final String AUTHORITY = Supermanager.AUTHORITY_BASE+".myteamdetail";
    	
    	// This class cannot be instantiated
        private MyTeamDetail() {}
        
        /**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/myteamdetail");

        /**
         * The MIME type of {@link #CONTENT_URI} providing a directory of notes.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/cat.joronya.supermanager.myteamdetail";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/cat.joronya.supermanager.myteamdetail";
        
        /**
         * The default sort order for this table
         */
        public static final String DEFAULT_SORT_ORDER = "position ASC";

        /**
         * The fields of the team on supermanger.acb.com
         */
        public static final String ID_EQU = "id_equ";
        public static final String DAY = "day";
        public static final String ID_PLAYER = "id_player";
        public static final String POSITION = "position";
        public static final String COST = "cost";
        public static final String SIGNING_DAY = "signing_day";
        public static final String PRICE = "price";
        public static final String WIN = "win";
        public static final String RATING = "rating";
        public static final String POINTS = "points";
        public static final String REBOUNDS = "rebounds";
        public static final String THREE = "three";
        public static final String ASSISTS = "assists";
        public static final String RATING_AVERAGE = "rating_average";
        public static final String POINTS_AVERAGE = "points_average";
        public static final String REBOUNDS_AVERAGE = "rebounds_average";
        public static final String THREE_AVERAGE = "three_average";
        public static final String ASSISTS_AVERAGE = "assists_average";
        public static final String MODIFIED_DATE = "modified";
        
        /**
         * Complete table projection.
         */
        public static final String[] PROJECTION = new String[]{
        	_ID,				// 0
        	ID_EQU,				// 1
        	DAY,				// 2
        	ID_PLAYER,			// 3
        	COST,				// 4
        	SIGNING_DAY,		// 5
        	PRICE,				// 6
        	WIN,				// 7
        	RATING,				// 8
        	POINTS,				// 9
        	REBOUNDS,			// 10
        	THREE,				// 11
        	ASSISTS,			// 12
        	RATING_AVERAGE,		// 13
        	POINTS_AVERAGE,		// 14
        	REBOUNDS_AVERAGE,	// 15
        	THREE_AVERAGE,		// 16
        	ASSISTS_AVERAGE		// 17
        };
    }
    
	/**
     * Market table
     */
    public static final class Market implements BaseColumns 
    {
    	// l'authority de la private league
    	public static final String AUTHORITY = Supermanager.AUTHORITY_BASE+".market";
    	
    	// This class cannot be instantiated
        private Market() {}
        
        /**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/market");

        /**
         * The MIME type of {@link #CONTENT_URI} providing a directory of notes.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/cat.joronya.supermanager.market";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/cat.joronya.supermanager.market";
        
        /**
         * The default sort order for this table.
         */
        public static final String DEFAULT_SORT_ORDER = "price DESC";
        
        /**
         * The player supermanager ID.
         */
        public static final String ID_PLAYER = "id_player";
        public static final String POSITION = "position";
        public static final String STATUS = "status";
        public static final String NACIONALITY = "nacionality";
        public static final String NAME = "name";
        public static final String DAY = "day";
        public static final String INFO = "info";
        public static final String TEAM = "team";
        public static final String BALANCE = "balance";
        public static final String AVERAGE = "average";
        public static final String PRICE = "price";
        public static final String MINUTES = "minutes";
        public static final String RATING = "rating";
        public static final String RATING_LAST3_GAMES = "rating_last3_games";
        public static final String INCREASE_15 = "increase_15";
        public static final String KEEP_PRICE = "keep_price";
        public static final String DECREASE_15 = "decrease_15";
        public static final String MODIFIED_DATE = "modified";
        
        /**
         * Complete table projection.
         */
        public static final String[] PROJECTION = new String[]{
        	_ID,				// 0
        	ID_PLAYER,			// 1
        	POSITION,			// 2
        	STATUS,				// 3
        	NACIONALITY,		// 4
        	NAME,				// 5
        	INFO,				// 6
        	TEAM,				// 7
        	BALANCE,			// 8
        	AVERAGE,			// 9
        	PRICE,				// 10
        	MINUTES,			// 11
        	RATING,				// 12
        	RATING_LAST3_GAMES,	// 13
        	INCREASE_15,		// 14
        	KEEP_PRICE,			// 15
        	DECREASE_15			// 16
        };
    }

	/**
     * Home information table
     */
    public static final class Home implements BaseColumns 
    {
    	// l'authority de la private league
    	public static final String AUTHORITY = Supermanager.AUTHORITY_BASE+".home";
    	
    	// This class cannot be instantiated
        private Home() {}
        
        /**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/home");

        /**
         * The MIME type of {@link #CONTENT_URI} providing a directory of notes.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/cat.joronya.supermanager.home";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/cat.joronya.supermanager.home";
        
        /**
         * The default sort order for this table
         */
        public static final String DEFAULT_SORT_ORDER = "day DESC";
        
        /**
         * The id of the private league on supermanger.acb.com
         */
        public static final String DAY = "day";
        public static final String STATUS = "status";
        public static final String INFO = "info";
        public static final String DUE_TIME = "due_time";
        public static final String MODIFIED_DATE = "modified";
        
        /**
         * Complete projection.
         */
        public static final String[] PROJECTION = new String[]{
        	_ID,				// 0
        	DAY,				// 1
        	STATUS,				// 2
        	INFO,				// 3
        	DUE_TIME			// 4
        };
    }

}
